[?php if ($sf_user->hasFlash('notice')): ?]
  <div class="notice flash_message">
    [?php if ($sf_user->hasFlash('batch_executed')): ?]
      <span class="expander">[?php echo link_to_function("[".__('show')."]", "$('batch_executed_msgs').blindDown(); $(this).fade(); $(this).blindUp();") ?]</span>
    [?php endif ?]
    [?php echo __($sf_user->getFlash('notice'), array(), 'sf_admin') ?]
  </div>
[?php endif; ?]

[?php if ($sf_user->hasFlash('batch_executed')): ?]
  <div class="batch_executed flash_message" style="display: none" id="batch_executed_msgs">
    <ul>
      [?php foreach ($sf_user->getFlash("batch_executed") as $value): ?]
        <li>[?php echo __(strval($value), array(), 'sf_admin') ?]</li>
      [?php endforeach ?]
    </ul>
  </div>
[?php endif ?]

[?php if ($sf_user->hasFlash('error')): ?]
  <div class="error flash_message">
    [?php if ($sf_user->hasFlash('batch_not_executed')): ?]
      <span class="expander">[?php echo link_to_function("[".__('show')."]", "$('batch_not_executed_msgs').blindDown(); $(this).fade(); $(this).blindUp();") ?]</span>
    [?php endif ?]
    [?php echo __($sf_user->getFlash('error'), array(), 'sf_admin') ?]
  </div>
[?php endif; ?]

[?php if ($sf_user->hasFlash('batch_not_executed')): ?]
  <div class="batch_not_executed flash_message" style="display: none" id="batch_not_executed_msgs">
    <ul>
      [?php foreach ($sf_user->getFlash("batch_not_executed") as $value): ?]
        <li>[?php echo __(strval($value), array(), 'sf_admin') ?]</li>
      [?php endforeach ?]
    </ul>
  </div>
[?php endif ?]

[?php if ($sf_user->hasFlash('warning')): ?]


  <div class="sf_warning flash_message">
    [?php if ($sf_user->hasFlash('warning_detail')): ?]
      <span class="expander">[?php echo link_to_function("[".__('show')."]", "$('warning_detail_msgs').blindDown(); $(this).fade(); $(this).blindUp();") ?]</span>
    [?php endif ?]
    [?php echo __($sf_user->getFlash('warning'), array(), 'sf_admin') ?]
  </div>

  [?php if ($sf_user->hasFlash('warning_detail')): ?]
    <div class="warning_detail flash_message" style="display: none" id="warning_detail_msgs">
      <ul>
        [?php foreach ($sf_user->getFlash("warning_detail") as $value): ?]
          <li>[?php echo __(strval($value), array(), 'sf_admin') ?]</li>
        [?php endforeach ?]
      </ul>
    </div>
  [?php endif ?]
[?php endif; ?]

<?php if (isset($this->params['animate_flashes']) && $this->params['animate_flashes']): ?>
<?php $delay = (isset($this->params['flashes_animation_delay']) ? $this->params['flashes_animation_delay'] : 5000) ?>
[?php use_helper('Javascript') ?]

[?php echo javascript_tag() ?]
  jQuery(document).ready(function() { jQuery('.notice').fadeOut(<?php echo $delay ?>); });
[?php echo end_javascript_tag() ?]
<?php endif; ?>
